package com.lrabbit.rabbit.api.user;

import com.lrabbit.msg.CommResponse;
import com.lrabbit.rabbit.api.user.request.SysUserAddReq;
import com.lrabbit.rabbit.api.user.request.SysUserPageReq;
import com.lrabbit.rabbit.api.user.request.SysUserSearchReq;
import com.lrabbit.rabbit.api.user.request.SysUserUpdateReq;
import com.lrabbit.rabbit.api.user.response.SysUserVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 用户表 自定义Controller
 *
 * @author common-generator
 * @since 2024-06-22
 */
@Api(tags = "用户表API管理")
@RequestMapping("/api/SysUser")
public interface SysUserApi {

    @ApiOperation(value = "添加用户表", notes = "添加用户表", httpMethod = "POST")
    @RequestMapping(value = "/actions/add", method = RequestMethod.POST)
    CommResponse addSysUser(@Valid @RequestBody SysUserAddReq addReq);

    @ApiOperation(value = "删除用户表", notes = "删除用户表", httpMethod = "POST")
    @RequestMapping(value = "/actions/delete", method = RequestMethod.POST)
    CommResponse deleteSysUser(@RequestParam("id") String id);

    @ApiOperation(value = "修改用户表", notes = "修改用户表", httpMethod = "POST")
    @RequestMapping(value = "/actions/update", method = RequestMethod.POST)
    CommResponse updateSysUser(@Valid @RequestBody SysUserUpdateReq updateReq);

    @ApiOperation(value = "查询用户表列表", notes = "查询用户表列表", httpMethod = "POST")
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    CommResponse<List<SysUserVO>> listSysUser(@Valid @RequestBody SysUserSearchReq searchReq);

    @ApiOperation(value = "查询用户表详情", notes = "查询用户表详情", httpMethod = "GET")
    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    CommResponse<SysUserVO> detailSysUser(@RequestParam("id") String id);

    @ApiOperation(value = "用户表查询-分页查询", notes = "用户表查询-分页查询", httpMethod = "POST")
    @RequestMapping(value = "/listPage", method = RequestMethod.POST)
    CommResponse<List<SysUserVO>> listPageSysUser(@Valid @RequestBody SysUserPageReq pageReq);
}